﻿using Inovout.Cloud.Web.Mvc;
using System.Collections.Generic;
using System.Web.Mvc;

namespace Inovout.Cloud.Identity.Console.Web.Controllers
{
    public class SettingsController : CloudController
    {
        private SettingsService settingsService;
        public SettingsController(SettingsService settingsService)
        {
            this.settingsService = settingsService;
        }
        public override ActionResult Index()
        {

            return View(settingsService.Get(Project));
        }

        [ValidateInput(false)]
        //[ValidateAntiForgeryToken]
        [HttpPost]
        public ActionResult Save(Dictionary<string, string> items)
        {
            settingsService.Save(Project, items);
            return RedirectToAction("Index", new { projectId = Project.Id });
        }
    }
}